package com.smart.five.ioc.java.configuration.spring;

import com.smart.five.ioc.java.configuration.LoginService;
import com.smart.five.ioc.java.configuration.bean.Appconf;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class JavaConfigSpring {
    public static void main(String[] args) {
        //使用@Configuration类提供的bean定义信息启动容器
        ApplicationContext ac = new AnnotationConfigApplicationContext(Appconf.class);
        LoginService loginService = (LoginService) ac.getBean("loginService");
        System.out.println(loginService);
    }
}
